# -*- coding: utf-8 -*-
def login():
    response.flash=request.vars
    if request.vars.username=='admin' and request.vars.password=='1':
        session.authorized=True
        redirect(URL('index'))
    session.counter = (session.counter or 0) + 1
    return dict(message="login", counter=session.counter)

def logout():
    """ Logout handler """
    session.authorized = None
    redirect(URL('pages','login'))

def index():
    return dict(message='index logo')

def hello():
    return 'hello world'